package dao;

import java.util.List;
import org.hibernate.Session;

import entity.MedioPagoBD;
import entity.RestauranteBD;

public class RestauranteDAO extends DAO{
	private static RestauranteDAO instancia = null;
	
	public static RestauranteDAO getInstancia(){
		if (instancia==null)			
			instancia=new RestauranteDAO();		
		return instancia;
	}	
	
	@SuppressWarnings("unchecked")
	public List<RestauranteBD> getRestaurantes() {
		Session s = super.getSession();
		List<RestauranteBD> r = s.createQuery("from RestauranteBD").list();
		s.close();
		return r;
		
	}
	
	@SuppressWarnings("unchecked")
	public List<MedioPagoBD> getMediosPago() {
		Session s = super.getSession();
		List<MedioPagoBD> mediosPago = s.createQuery("from MedioPagoBD").list();
		s.close();
		return mediosPago;
		
	}
}
